import static org.junit.Assert.*;

/**
 * Created by radish608 on 17-4-25.
 */
import junit.framework.TestCase;
import org.junit.Test;

import java.lang.management.BufferPoolMXBean;

public class StringBufferDemoTest extends TestCase {
    StringBuffer str=new StringBuffer("StringBuffer");
    @Test
    public void testcharAt (){
        assertEquals('S',str.charAt(0));
        assertEquals('B',str.charAt(6));
    }
    @Test
    public void testcapacity(){
        assertEquals(28,str.capacity());
    }
    @Test
    public void testindexof(){
        assertEquals(6,str.indexOf("Buffer"));
    }
    @Test
    public void testtoString(){
        assertEquals("str:StringBuffer","str:"+str.toString());
    }

}